fix(@angular/build): scope CHROME_BIN executable path to individual playwright instances#32897
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Vitest browser provider to correctly handle the CHROME_BIN environment variable by applying the custom executable path specifically to Chrome and Chromium instances when using Playwright. This change prevents the executable path from being incorrectly applied to other browser types in mixed configurations. Corresponding unit tests have been added to verify these changes. A review comment suggests extracting duplicated context options into a constant to improve code maintainability.
e83839f to
5371709
Compare
…laywright instances
Previously, if CHROME_BIN was set in the environment and a user ran tests targeting the Playwright provider, the path was applied to the global Playwright launch options. This caused tests to crash if a user requested non-Chromium browsers (like Firefox) alongside Chromium, because Playwright would incorrectly attempt to launch the Chrome binary for the Firefox instance.
This commit updates the browser configuration to map instances before providers are initialized, and selectively injects `launchOptions: { executablePath: process.env.CHROME_BIN }` at the individual instance level for chrome and chromium only. This restores parity where users can maintain CHROME_BIN variables while safely invoking alternative browsers.
5371709 to
d564550
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Previously, if CHROME_BIN was set in the environment and a user ran tests targeting the Playwright provider, the path was applied to the global Playwright launch options. This caused tests to crash if a user requested non-Chromium browsers (like Firefox) alongside Chromium, because Playwright would incorrectly attempt to launch the Chrome binary for the Firefox instance.
This commit updates the browser configuration to map instances before providers are initialized, and selectively injects
launchOptions: { executablePath: process.env.CHROME_BIN }at the individual instance level for chrome and chromium only. This restores parity where users can maintain CHROME_BIN variables while safely invoking alternative browsers.